package com.jiezhuo.service.impl.jw;

import com.jiezhuo.entity.jw.StuVo;
import com.jiezhuo.entity.jw.TStu;
import com.jiezhuo.mapper.center.TStuMapper;
import com.jiezhuo.service.jw.TStuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiezhuo.utils.R;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author com.jiezhuo
 * @since 2024-06-19
 */
@Service
public class TStuServiceImpl extends ServiceImpl<TStuMapper, TStu> implements TStuService {

    @Override
    public R selectStu(StuVo s) {
       int num= this.getBaseMapper().selectStuCount(s);
        ArrayList<HashMap<String ,Object>> stu= this.getBaseMapper().selectStu(s);
        return R.ok().data("list",stu).data("total",num);
    }

    @Override
    public R selectSchoolClassStudent(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClassStudent(s);
        int count=this.getBaseMapper().selectSchoolClassCount(s);
        return R.ok().data("list",arrayList).data("total",count);
    }

    @Override
    public R selectSchoolClass(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClass(s);
        return R.ok().data("list",arrayList);
    }

    @Override
    public R selectSchoolClassList(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClassList(s);
        return  R.ok().data("list",arrayList);
    }

    @Override
    public R selectSchoolClassZb(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClassZb(s);
        return  R.ok().data("list",arrayList);
    }

    @Override
    public R selectSchoolClassZbCourse(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClassZbCourse(s);
        return  R.ok().data("list",arrayList);
    }

    @Override
    public R selectSchoolClassZbCourseInfo(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectSchoolClassZbCourseInfo(s);
        return  R.ok().data("list",arrayList);
    }

    @Override
    public R selectHistoryStu(StuVo s) {
        ArrayList<HashMap<String, Object>> arrayList = this.getBaseMapper().selectHistoryStu(s);
        int count=this.getBaseMapper().selectHistoryStuCount(s);
        return R.ok().data("list",arrayList).data("total",count);
    }

    @Override
    public R selectHistoryStuInfo(StuVo s) {
        HashMap<String,String> hashMap= this.getBaseMapper().selectHistoryStuInfo(s);
        return  R.ok().data("list",hashMap);
    }
}
